module.exports = (app) => {
    const { controller, router } = app;
    // 定义根路由
    router.get("/", controller.home.index);
    // 登录
    router.post("/login", controller.home.login);
    // 注册
    router.post("/register", controller.home.register);

    // 博客
    router.get("/blogs", controller.blog.index);
    router.get("/blogs/:id", controller.blog.detail);
    router.post("/blogs", controller.blog.create);
    router.del("/blogs/:bid", controller.blog.delete);

    // 添加评论
    router.get("/blogs/:bid/comments", controller.comment.index);
    router.post("/comments", controller.comment.create);
};
